package com.shitou.shitoumember.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.netflix.ribbon.proxy.annotation.Http;
import com.shitou.shitoucommons.utils.PageUtils;
import com.shitou.shitoucommons.utils.RespBean;
import com.shitou.shitoumember.entity.MemberEntity;
import com.shitou.shitoumember.vo.*;
import org.springframework.util.MultiValueMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 会员
 *
 * @author shitouren
 * @email 3076767823@qq.com
 * @date 2023-03-28 16:52:06
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);


    /**
     * 登录
     * @param loginVo 用户信息
     * @return
     */
    RespBean doLogin(LoginVo loginVo, HttpServletRequest request, HttpServletResponse response);

    /**
     * 登录，是否需要验证码登录
     * @param loginVo
     * @param request
     * @param checkCaptcha
     * @return
     */
    RespBean doLogin(LoginVo loginVo, HttpServletRequest request, HttpServletResponse response, boolean checkCaptcha);

    /**
     * 注册
     * @param registerVo
     * @returnnio-8002-exec-1
     */
    RespBean doRegister(RegisterVo registerVo);

    /**
     * 注册，是否需要验证码注册
     * @param registerVo
     * @param checkCaptcha
     * @return
     */
    RespBean doRegister(RegisterVo registerVo, boolean checkCaptcha);

    /**
     * 退出
     * @param memberId
     * @return
     */
    RespBean doLoginOut(long memberId);


    /**
     * 更具token和用户名密码查询并返回信息
     * @param request
     * @return RespBean
     */
    RespBean memberInfo(HttpServletRequest request, HttpServletResponse response);


    /**
     * 更新nickname和gender
     * @param nicknameGenderVo
     * @return
     */
    RespBean updateNicknameGender(UpdateNicknameGenderVo nicknameGenderVo);

    /**
     * 更新头像
     * @param headerVo
     * @return
     */
    RespBean updateHeader(UpdateHeaderVo headerVo);


    /**
     * 更新邮箱
     * @param emailVo
     * @return
     */
    RespBean updateEmail(UpdateEmailVo emailVo);


    /**
     * 找回密码
     * @param passwordVo
     * @return
     */
    RespBean findPassword(UpdatePasswordVo passwordVo);


    /**
     * 远程调用,获取用户信息
     * @param memberId
     * @return
     */
    RespBean getMemberVo(long memberId, HttpServletRequest request, HttpServletResponse response);


    /**
     * 远程调用，判断是否登录
     * @param cookies
     * @return true or false
     */
    RespBean checkLogin(String cookies, HttpServletResponse response);


    /**
     * 获取用户信息
     * @param memberIds
     * @return
     */
    RespBean getMemberInfoByMemberIds(long[] memberIds);


    /**
     * 通过token令牌获取用户信息
     * @param token 令牌
     * @param request
     * @param response
     * @return
     */
    MemberEntity getMemberByToken(String token, HttpServletRequest request, HttpServletResponse response);


    /**
     * 前端调用，校验该页面是否要需要登陆才能访问
     * @param request
     * @return
     */
    RespBean fore_endCheckLogin(HttpServletRequest request, HttpServletResponse response);


    /**
     * 获得商品发布者的信息
     * @param memberId
     * @return
     */
    RespBean getPublisher(Long memberId);


    /**
     * 通过会员id获取会员信息
     * @param MemberId
     * @return
     */
    RespBean getMemberByMemberId(Long MemberId);
}

